package com.example.service.impl;

import com.example.dao.PetDao;
import com.example.entity.Pet;
import com.example.service.PetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class PetServiceImpl implements PetService {
@Autowired
private PetDao petDao;
    @Override
    public List<Pet> petList(Integer user_id) {
        return petDao.petList(user_id);
    }

    @Override
    public List<Pet>  getPetById(Integer pet_id) {
        return petDao.getPetById(pet_id);
    }
    @Override
    public int addPet(Pet pet) {
        return petDao.insertPet(pet);
    }
}
